API documentation
Integrations
Analytics
Billable events
Companies
Coupons > Promotion codes
Custom properties
Customers
Customers > Credits
Customers > Payment methods
Integrations
Invoices
Invoices > Transactions
Invoicing entities
Organisations
Payments
Price configurations
Products
Quotes
Subscriptions
- GETGet subscriptions
- GETGet subscription
- GETGet subscription phases
- GETGet subscription phase
- POSTCreate subscription update
- POSTCreate subscription updates
- POSTCreate subscription
- PUTUpdate subscription
- POSTActivate subscription
- POSTCancel subscription
- POSTPause subscription
- POSTReactivate subscription
- POSTRefresh seat products
- POSTRefresh subscriptions
- POSTReinstate subscription
- POSTTransition subscription to next phase
Third-party apps
Wallets
Coupons > Promotion codes
Update promotion code
Update the details of an existing promotion code.
PUT
/
v1
/
promotion-codes
/
{id}
curl --request PUT \
--url https://api.hyperline.co/v1/promotion-codes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"code": "PROMO123",
"customer_id": "cus_DKL4Xcb5VSa8CQ",
"plan_id": "plan_DKL4Xcb5VSa8CQ",
"product_id": "itm_DKL4Xcb5VSa8CQ",
"expires_at": "2021-01-01T00:00:00.000Z",
"max_redemptions": 10,
"current_redemptions": 0,
"duration_count": 1,
"duration_period": "months",
"only_for_first_time_order": false
}'
{
"id": "promo_DKL4Xcb5VSa8CQ",
"code": "PROMO123",
"coupon_id": "cou_DKL4Xcb5VSa8CQ",
"client_id": "cli_DKL4Xcb5VSa8CQ",
"customer_id": "cus_DKL4Xcb5VSa8CQ",
"plan_id": "plan_DKL4Xcb5VSa8CQ",
"product_id": "itm_DKL4Xcb5VSa8CQ",
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"expires_at": "2021-01-01T00:00:00.000Z",
"max_redemptions": 10,
"current_redemptions": 0,
"duration_count": 1,
"duration_period": "months",
"only_for_first_time_order": false
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Body
application/json
Response
200
application/json
The response is of type object
.
Was this page helpful?
curl --request PUT \
--url https://api.hyperline.co/v1/promotion-codes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"code": "PROMO123",
"customer_id": "cus_DKL4Xcb5VSa8CQ",
"plan_id": "plan_DKL4Xcb5VSa8CQ",
"product_id": "itm_DKL4Xcb5VSa8CQ",
"expires_at": "2021-01-01T00:00:00.000Z",
"max_redemptions": 10,
"current_redemptions": 0,
"duration_count": 1,
"duration_period": "months",
"only_for_first_time_order": false
}'
{
"id": "promo_DKL4Xcb5VSa8CQ",
"code": "PROMO123",
"coupon_id": "cou_DKL4Xcb5VSa8CQ",
"client_id": "cli_DKL4Xcb5VSa8CQ",
"customer_id": "cus_DKL4Xcb5VSa8CQ",
"plan_id": "plan_DKL4Xcb5VSa8CQ",
"product_id": "itm_DKL4Xcb5VSa8CQ",
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"expires_at": "2021-01-01T00:00:00.000Z",
"max_redemptions": 10,
"current_redemptions": 0,
"duration_count": 1,
"duration_period": "months",
"only_for_first_time_order": false
}
Assistant
Responses are generated using AI and may contain mistakes.